/*
  @Time:   2021-04-10
  @File:   指针.go
  @Author: ls
*/
package main

import "fmt"

func DoSomething1(a *int) {
	fmt.Println(&a)
	b := a
	fmt.Println(&b)
	fmt.Println(*b)
	*b = 30
	fmt.Println(&b)
	fmt.Println(&a)
	fmt.Println(*a)
	fmt.Println()
}

func DoSomething2(a1 int) {
	fmt.Println(&a1)
	b := &a1
	fmt.Println(&b)
	fmt.Println(*b)
	*b = 40
	fmt.Println(&b)
	fmt.Println(&a1)
	fmt.Println(a1)
}

func main() {
	var a = 20
	var i *int
	i = &a
	DoSomething1(i)
	DoSomething2(a)
}


